import { AnyColumn } from 'element-plus/es/components/table-v2/src/common';
import request from '/@/utils/request';
const headers = {
	// onlyData: true,
};
//弹窗查询三张清单新增列表
export const getThreeList = (query?: Object) => {
	return request({
		url: `/manage/app/declare/get/three/list`,
		method: 'get',
		headers,
		params: query,
	});
};
//申报分页查询
export const declarePage = (query?: any) => {
	if (query.timeArr) {
		query['startTime'] = query.timeArr[0];
		query['endTime'] = query.timeArr[1];
		delete query.timeArr;
	}
	return request({
		url: `/manage/app/declare/page`,
		method: 'get',
		headers,
		params: query,
	});
};
//申报编辑/详情查询
export const declareByIdAppDe = (query?: Object) => {
	return request({
		url: `/manage/app/declare/getByIdAppDeclareDetail`,
		method: 'get',
		headers,
		params: query,
	});
};
//列表删除
export function declareDelete(id: string) {
	return request({
		url: `/manage/app/declare/delete/${id}`,
		method: 'delete',
		headers,
	});
}
//列表撤销
export function declareCancel(instanceId: string) {
	return request({
		url: `/manage/app/declare/cancel/${instanceId}`,
		method: 'post',
		headers,
	});
}
//列表撤销（新流程）
export function declareCancelByNew(data: any) {
	return request({
		url: `manage/task/stopProcessInstance`,
		method: 'post',
		data,
	});
}

//列表修改
export function dataModifySubmitApplication(data?: any) {
	return request({
		url: `/manage/dataModify/submitApplication`,
		method: 'post',
		headers,
		data,
	});
}
//申报
export const declareSubmit = (data?: any) => {
	return request({
		url: `/manage/app/declare/submit`,
		method: 'post',
		headers,
		data,
	});
};
//保存
export const declareSave = (data?: any) => {
	return request({
		url: `/manage/app/declare/save`,
		method: 'post',
		headers,
		data,
	});
};
//审核页面-代办分页
export const declarePendingTask = (data?: any) => {
	return request({
		url: `/manage/app/declare/pending/task`,
		method: 'post',
		headers,
		data,
	});
};
//审核页面-已办分页
export const declareDoneTask = (data?: any) => {
	return request({
		url: `/manage/app/declare/done/task`,
		method: 'post',
		headers,
		data,
	});
};
//文件下载
export const declareLocalFile = (fileName?: any) => {
	return request({
		url: `/manage/local/file/${fileName}`,
		method: 'get',
		headers,
		responseType: 'blob',
	});
};
